package org.jackysoft.struts2.admin;

import java.util.Collection;

import org.apache.struts2.convention.annotation.Namespace;
import org.jackysoft.annotations.Logger;
import org.jackysoft.entity.Role;
import org.jackysoft.service.RoleService;
import org.jackysoft.struts2.UtilsCRUDAction;
import org.jackysoft.util.OperationType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;


@Controller
@Namespace("/admin/role")
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Logger(label="角色",logType=OperationType.System)
public class RoleAction extends UtilsCRUDAction<Role> {
	/**
	 * 
	 */
	private static final long serialVersionUID = 8129731670407512711L;
	private RoleService service;
	private Role bean;
	private Collection<Role> beans;
	
	@Override
	public String gets()throws Exception{
		beans = service.gets();
		return BEANLIST;
	}
	
	
	public Role getBean() {
		return bean;
	}

	public void setBean(Role bean) {
		this.bean = bean;
	}

	public Collection<Role> getBeans() {
		return beans;
	}

	public void setBeans(Collection<Role> beans) {
		this.beans = beans;
	}

	public RoleService getService() {
		return service;
	}

	@Autowired
	public void setService(RoleService service) {
		this.service = service;
		this.setDataProvider(service);
	}
}
